package com.xunk.equipment.service.zhijia.service;

import com.xunk.common.core.web.domain.AjaxResult;
import com.xunk.equipment.websocket.ZhijiaWebSocketClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ProjectName: HIM
 * @Package: com.xunk.equipment.service.zhijia.service
 * @ClassName: ZhijiaSocketService
 * @Author: luanzhiwei
 * @Description: 智家websocket服务
 * @Date: 2021/4/26 13:53
 * @Version: 1.0
 */
@Service
public class ZhijiaSocketService {

    @Autowired
    private ZhijiaWebSocketClient socketClient;

    /**
     * 取消订阅
     *
     * @return
     */
    public AjaxResult unsubscribe() {
        boolean unsubscribe = socketClient.unsubscribe();
        if (unsubscribe) {
            return AjaxResult.success();
        } else {
            return AjaxResult.error();
        }
    }



}
